<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
</head>
<body>


    <script>
        // 数字
        var num = 100;
        // 数字转换字符串
        var str = num.toString();
        console.log(typeof str);
        console.log(str);

        var v4 = 14;
        var r4 = v4.toString(2);//注意括号里面的数字，它代表多少进制
        console.log(r4);

        // 参数：基线（进制）
        var v1 = 15;
        var r1 = v1.toString(2);
        console.log(r1);// 1111

        var v2 = 12;
        var r2 = v2.toString(2);
        console.log(r2);// 1100


        var v3 = 11;
        var r3 = v3.toString(16);
        console.log(r3);// b 

        // 0-9a-f
        // 0-f


    </script>
</body>
</html>